<template>
	<view class="TechnicianServiceItem" @click="goto">
		<view class="item-img flex-grow-0">
			<!-- <image src="/static/images/pic1.png" mode="aspectFill"></image> -->
			<!-- <image :src="item.avatarPath?item.avatarPath:'/static/images/pic1.png'" mode="aspectFill"></image> -->
			<uv-image :src="item.avatarPath" width="100%" height="100%" ></uv-image>
		</view>
		<view class="item-cont flex-grow-1">
			<view class="name font32">{{item.nickName}}</view>
			<view class="ds">
				已服务<text>{{item.orderNum?item.orderNum:0}}</text>人 好评率<text>{{item.evaluateNum?item.evaluateNum:0}}%</text>
			</view>
			<view class="label-item">
				<template  v-for="(v,i) in item.healthName" :key="i">
					<uv-tags v-if="i<5&&v" :text="v"  :type="tabtypeList[i]" plain plainFill size="mini"></uv-tags>
				</template>
				
			<!-- 	<uv-tags text="睡眠" plain plainFill size="mini"></uv-tags>
				<uv-tags text="颈椎" type="warning" plain plainFill size="mini"></uv-tags>
				<uv-tags text="颈椎" type="success" plain plainFill size="mini"></uv-tags> -->
			</view>
			<view class="fw">
				{{item.isReservation?'可预约':'服务中'}}
			</view>
			<view class="btn">{{type==1?'立即预约':'选择'}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "TechnicianService-item",
		data() {
			return {
				placeOrder:null,
				itemInfo:{
				},
				tabtypeList:[
					'primary',
					'warning',
					'success',
					'info',
					'error',
				],
			};
		},
		props:{
			item: {
				type: Object,
				default: {
					healthName:null
				}
			},
			type:{
				type:Number,
				default:1,//1跳转详情，2选择技师
			}
		},
		mounted() {
			// // this.itemInfo=this.item
			// this.itemInfo.healthName=this.itemInfo.healthName?this.itemInfo.healthName.split(','):[],
			// console.log(this.itemInfo.healthName)
			// debugger
			
		},
		computed:{
			
		},
		methods:{
			goto(){
				if(this.type==1){
					uni.navigateTo({
						url:'/pages/TechnicianDetails/TechnicianDetails?userId='+this.item.userId
					})	
				}else if(this.type==2){
					this.$emit('onChang',{
						userId:this.item.userId,
						nickName:this.item.nickName
					})
				}
				
			}
		},
		
	}
</script>

<style lang="less" scoped>
	.TechnicianServiceItem {
		width: 100%;
		// height: 210rpx;
		background-color: #ffffff;
		border-radius: 10rpx;
		margin-top: 20rpx;
		display: flex;
		padding: 15rpx;
		box-sizing: border-box;
		position: relative;
		align-items: center;

		.item-img {
			width: 182rpx;
			height: 182rpx;
			background-color: #f6f6f6;
			border-radius: 10rpx;
			background: #f1f1f1;
			margin-right: 23rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.fw {
			position: absolute;
			top: 15rpx;
			right: 30rpx;
			color: #61bfbe;

		}

		.name {
			color: #333;
			font-weight: bold;

		}

		.ds {
			margin: 20rpx 0px;
			color:#666;
			text{
				color: #333;
			}
		}

		.label-item {
			display: flex;
			// padding: 24rpx 0px;

		}

		.btn {
			position: absolute;
			bottom: 30rpx;
			right: 20rpx;
			padding: 0px 14rpx;
			height: 50rpx;
			background-color: #60bcbb;
			border-radius: 25rpx;
			text-align: center;
			line-height: 48rpx;
			color: #fff;

		}
	}

</style>